home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 42 / Amiga Format AFCD42 (Issue 126, Aug 1999).iso / -serious- / hardware / blizkick / modules / speedyide.asm < prev    next >
Assembly Source File  |  1999-05-17  |  2KB  |  114 lines

  1. ; FILE: Source:modules/SpeedyIDE.ASM          REV: 3 --- Speed up scsi.device access
  2.  
  3. ;
  4. ; Speed up scsi.device IDE disk access
  5. ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  6. ; Written by Harry Sintonen.
  7. ; This source code is Public Domain.
  8. ;
  9.  
  10.     incdir    "include:"
  11.     include    "blizkickmodule.i"    ; Some required...
  12.  
  13.     SECTION    PATCH,CODE
  14. _DUMMY_LABEL
  15.     BK_PTC
  16.  
  17. ; Code is run with following incoming parameters:
  18. ;
  19. ; a0=ptr to ROM start (buffer)    eg. $1DE087B8
  20. ; a1=ptr to ROM start (ROM)    eg. $00F80000 (do *not* access!)
  21. ; d0=ROM lenght in bytes    eg. $00080000
  22. ; a2=ptr to _FindResident routine (will search ROM buffer for resident tag):
  23. ;    CALL: jsr (a2)
  24. ;      IN: a0=ptr to ROM, d0=rom len, a1=ptr to resident name
  25. ;     OUT: d0=ptr to resident (buf) or NULL
  26. ; a3=ptr to _InstallModule routine (can be used to plant a "module"):
  27. ;    CALL: jsr (a3)
  28. ;      IN: a0=ptr to ROM, d0=rom len, a1=ptr to module, d6=dosbase
  29. ;     OUT: d0=success
  30. ; a4=ptr to _Printf routine (will dump some silly things (errormsg?) to stdout ;-)
  31. ;    CALL: jsr (a4)
  32. ;      IN: a0=FmtString, a1=Array (may be 0), d6=dosbase
  33. ;     OUT: -
  34. ; d6=dosbase, a6=execbase
  35. ;
  36. ; Code should return:
  37. ;
  38. ; d0=true if succeeded, false if failed.
  39. ; d1-d7/a0-a6 can be trashed. a7 *must* be preserved! ;-)
  40.  
  41.     cmp.w    #37,($C,a0)
  42.     bhs.b    .cont
  43.     moveq    #0,d0
  44. .fail    rts
  45.  
  46. .cont    lea    (scsiname,pc),a1
  47.     jsr    (a2)
  48.     tst.l    d0
  49.     beq.b    .fail
  50.  
  51.     move.l    d0,a0            ; a0=beg of search
  52.     lea    (16384,a0),a1        ; a1=end of search
  53.  
  54.     move.l    #$700F32D0,d1
  55.     move.l    #$32D032D0,d2
  56.     bsr.b    .find
  57.     beq.b    .not_found
  58.     move.l    d0,a2
  59.  
  60.     move.l    #$700F3099,d1
  61.     move.l    #$30993099,d2
  62.     bsr.b    .find
  63.     beq.b    .not_found
  64.     move.l    d0,a3
  65.  
  66.     move.l    #$700722D0,d1
  67.     move.l    a2,a0
  68.     bsr.b    .set
  69.  
  70.     move.l    #$70072099,d1
  71.     move.l    a3,a0
  72.     bsr.b    .set
  73.  
  74.     moveq    #1,d0
  75.     rts
  76.  
  77. .not_found    moveq    #0,d0
  78.     rts
  79.  
  80. .find    movem.l    a0-a1,-(sp)
  81. .findl    addq.l    #2,a0
  82.     cmp.l    a1,a0
  83.     bhs.b    .fnot_found
  84.     cmp.l    (a0),d1
  85.     bne.b    .findl
  86.     cmp.l    (4,a0),d2
  87.     bne.b    .findl
  88.     cmp.l    (8,a0),d2
  89.     bne.b    .findl
  90.     cmp.l    (12,a0),d2
  91.     bne.b    .findl
  92.     cmp.l    (16,a0),d2
  93.     bne.b    .findl
  94.     move.l    a0,d0
  95. .fexit    movem.l    (sp)+,a0-a1
  96.     rts
  97. .fnot_found    moveq    #0,d0
  98.     bra.b    .fexit
  99.  
  100. .set    move.l    d1,(a0)+
  101.     moveq    #16-1-1,d0
  102. .setl    move.w    d1,(a0)+
  103.     dbf    d0,.setl
  104.     rts
  105.  
  106.  
  107. scsiname    dc.b    'scsi.device',0
  108.  
  109.  
  110.     SECTION    VERSION,DATA
  111.  
  112.     dc.b    '$VER: SpeedyIDE_PATCH 1.0 (21.5.97)',0
  113.  
  114.